package de.koller.aframe.util.resource;

import de.koller.oceanFramework.gl.util.ImagePreview;
import java.awt.image.BufferedImage;

public class ResourceMaker {

	private ResourceMaker() {}
	
	public static void tileMap( int tiles, int tileSize, String file ) {
		BufferedImage img = new BufferedImage( tiles*tileSize, tiles*tileSize, BufferedImage.TYPE_INT_ARGB );
		for( int x = 0; x < img.getWidth(); x++ )
			for( int y = 0; y < img.getHeight(); y++ ) {
				img.setRGB( x, y, 0xff_ffffff );
				
				int tx = x / tileSize;
				int ty = y / tileSize;
				
				if( (tx%2==0 && (ty+1)%2==0) || ((tx+1)%2==0 && ty%2==0) )
					img.setRGB( x, y, 0xff_808080 );
			}
		
		IOLoader.savePNG( img, file );
	}
	
	public static void main( String[] args ) {
		ResourceMaker.tileMap( 64, 16, "./gameData/singularity/tiles.png" );
	}
	
}
